Fix deepgram/parakeet workers bug #199
Conversation
…se.yml for OpenMemory MCP - Added conditional start for Deepgram worker based on DEEPGRAM_API_KEY presence. - Updated shutdown and monitoring functions to handle AUDIO_STREAM_WORKER_PID safely. - Changed OpenMemory MCP service to use the official Docker image instead of a local build. - Removed deprecated init-cache.sh script and streamlined setup.sh for clarity.
- Introduced conditional starting of Parakeet worker based on PARAKEET_ASR_URL or OFFLINE_ASR_TCP_URI presence. - Updated variable names for clarity, changing AUDIO_STREAM_WORKER_PID to AUDIO_STREAM_DEEPGRAM_WORKER_PID and added AUDIO_STREAM_PARAKEET_WORKER_PID. - Improved shutdown and monitoring functions to handle new worker PIDs safely.
…ckend for all proxy configurations - Changed reverse proxy targets for WebSocket, API, Auth, Health, Readiness, Users, and Audio endpoints from friend-backend:8000 to chronicle-backend:8000. - Ensured consistency across all relevant sections of the Caddyfile.template.
- Changed the default network name in backends/advanced/docker-compose.yml from friend-network to chronicle-network. - Updated extras/openmemory-mcp/docker-compose.yml to include chronicle-network as an external network and added it to the services configuration.
WalkthroughThis PR updates infrastructure naming conventions and service configurations across the backend and extras modules. It renames the Docker network and backend service from friend-based names to chronicle-based names, introduces conditional startup logic for audio streaming workers based on environment variables, migrates OpenMemory MCP to use an official Docker image, and removes cache initialization scripts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
backends/advanced/Caddyfile.template(3 hunks)backends/advanced/docker-compose.yml(1 hunks)backends/advanced/start-workers.sh(5 hunks)extras/openmemory-mcp/docker-compose.yml(3 hunks)extras/openmemory-mcp/init-cache.sh(0 hunks)extras/openmemory-mcp/setup.sh(1 hunks)extras/speaker-recognition/docker-compose.yml(1 hunks)
💤 Files with no reviewable changes (1)
- extras/openmemory-mcp/init-cache.sh
🧰 Additional context used
📓 Path-based instructions (1)
**/docker-compose*.{yml,yaml}
📄 CodeRabbit inference engine (CLAUDE.md)
Check if src/ is volume mounted. If not, run
docker compose buildso that code changes are reflected. Do not simply rundocker compose restartas it will not rebuild the image.
Files:
backends/advanced/docker-compose.ymlextras/speaker-recognition/docker-compose.ymlextras/openmemory-mcp/docker-compose.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: speaker-recognition-tests
🔇 Additional comments (11)
backends/advanced/start-workers.sh (5)
54-73: LGTM! Conditional worker startup logic is well-implemented.The conditional startup for both Deepgram and Parakeet workers correctly checks for required environment variables before starting the respective workers. Setting PID variables to empty strings when workers are skipped ensures proper behavior in later conditional checks throughout the script.
83-84: LGTM! Status output properly reflects conditional workers.The conditional echo statements correctly display worker PIDs only when the workers are actually started, providing accurate runtime information.
124-126: LGTM! Self-healing monitor properly handles conditional workers.The monitor correctly kills only active workers based on their PID variables, ensuring that workers that were never started are not targeted. The use of
|| trueproperly prevents script failure when attempting to kill non-existent processes.
151-152: LGTM! Shutdown handler properly manages conditional workers.Consistent with the self-healing monitor, the shutdown function correctly handles conditional workers by checking PID variables before attempting to kill processes.
185-186: LGTM! Final termination path consistently handles conditional workers.The implementation maintains consistency with the other kill operations in the script, ensuring reliable cleanup of all active workers.
backends/advanced/docker-compose.yml (1)
229-229: LGTM! Network rename aligns with PR objectives.The network name change from
friend-networktochronicle-networkis consistent with the infrastructure naming convention updates across the repository.backends/advanced/Caddyfile.template (2)
22-27: LGTM! Backend rename and WebSocket header improvement.The proxy target update to
chronicle-backend:8000aligns with the service name indocker-compose.yml. The addition ofX-Forwarded-Proto {scheme}header ensures proper protocol scheme information is forwarded to the backend, which is particularly important for WebSocket connections.
32-56: LGTM! Consistent backend proxy target updates.All backend proxy targets have been consistently updated to
chronicle-backend:8000across all API, auth, health, user, and audio endpoints, ensuring uniform routing to the renamed service.extras/openmemory-mcp/setup.sh (1)
76-78: LGTM! Instructions updated for official Docker image usage.The removal of
--buildflag is appropriate since the service now uses the officialmem0/openmemory-mcp:latestimage. The Web UI URL correctly reflects the new port mapping (3001) defined indocker-compose.yml.extras/openmemory-mcp/docker-compose.yml (2)
34-44: LGTM! UI service improvements enhance reliability.The addition of
restart: unless-stoppedpolicy improves service reliability, and the updated comment accurately reflects that the UI now starts by default alongside the MCP server.
11-32: Verify ifchronicle-networkconnectivity is required for this MCP service.The switch to the official
mem0/openmemory-mcp:latestimage is consistent with removing cache initialization scripts. However, the addition ofchronicle-networkconnectivity creates a startup dependency that isn't documented in the standard OpenMemory MCP architecture. Please confirm whether the MCP service actually communicates with services on this network, or if this should be removed.
| networks: | ||
| default: | ||
| name: openmemory-mcp_default | ||
| chronicle-network: | ||
| external: true No newline at end of file |
There was a problem hiding this comment.
The external chronicle-network dependency requires backend services to start first.
The chronicle-network is marked external: true, which means this compose file depends on the network being pre-created by backend services. This matches the pattern in extras/speaker-recognition/docker-compose.yml and creates an implicit service startup order requirement. Users must start the backend services before running docker compose up in this directory.
🤖 Prompt for AI Agents
In extras/openmemory-mcp/docker-compose.yml around lines 46 to 50, the
chronicle-network is marked external: true which creates an implicit dependency
on backend services having pre-created that network; change the network to be
created by this compose file instead of requiring an external network by
removing external: true and defining the network locally (set an explicit name
and optional driver) so docker compose up will create it automatically; ensure
the network section uses a local definition consistent with other compose files
(e.g., provide name: openmemory-chronicle-network and remove external: true).
| name: chronicle-network | ||
| external: true No newline at end of file |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for docker-compose files and look for chronicle-network
echo "=== Finding docker-compose files ==="
find . -name "docker-compose*.yml" -o -name "docker-compose*.yaml" | head -20
echo -e "\n=== Searching for chronicle-network in compose files ==="
rg -l "chronicle-network" -t yaml
echo -e "\n=== Examining network definitions ==="
rg "networks:" -A 5 -t yaml | head -50
echo -e "\n=== Looking for documentation about startup order ==="
find . -name "*.md" -o -name "*.txt" -o -name "README*" | xargs grep -l "startup\|start.*backend\|chronicle-network" 2>/dev/null | head -10Repository: chronicler-ai/chronicle
Length of output: 3238
🏁 Script executed:
#!/bin/bash
# Check documentation files for startup order guidance
echo "=== Checking getting-started.md ==="
grep -i "startup\|start.*backend\|docker.*compose\|order\|first\|second" ./Docs/getting-started.md | head -15
echo -e "\n=== Checking quickstart.md ==="
grep -i "startup\|start.*backend\|docker.*compose\|order\|first\|second" ./backends/advanced/Docs/quickstart.md | head -15
echo -e "\n=== Checking README.md ==="
grep -i "startup\|start.*backend\|docker.*compose\|order\|first\|second" ./README.md | head -15
echo -e "\n=== Full content of getting-started.md (first 100 lines) ==="
head -100 ./Docs/getting-started.md
echo -e "\n=== Checking if speaker-recognition or extras are mentioned in getting-started ==="
grep -i "speaker\|extras\|asr\|recognition" ./Docs/getting-started.mdRepository: chronicler-ai/chronicle
Length of output: 5977
🏁 Script executed:
#!/bin/bash
# Check the specific lines 111-112 in speaker-recognition/docker-compose.yml
echo "=== Lines 111-112 of extras/speaker-recognition/docker-compose.yml ==="
sed -n '110,115p' ./extras/speaker-recognition/docker-compose.yml
echo -e "\n=== Context around network definition (lines 105-115) ==="
sed -n '105,115p' ./extras/speaker-recognition/docker-compose.yml
echo -e "\n=== Network definition in backends/advanced/docker-compose.yml ==="
grep -A 3 "^networks:" ./backends/advanced/docker-compose.yml
echo -e "\n=== Verify backends/advanced network does NOT have external: true ==="
grep -A 3 "^networks:" ./backends/advanced/docker-compose.yml | grep -i external || echo "No 'external' keyword found - network is created by this compose file"Repository: chronicler-ai/chronicle
Length of output: 665
Document the chronicle-network external dependency requirement.
The chronicle-network is marked as external: true, requiring it to exist before this compose stack starts. While getting-started.md shows the correct startup sequence (backends/advanced first, then extras), add explicit documentation explaining that speaker-recognition depends on the network created by backends/advanced. This prevents confusion if users attempt to run speaker-recognition independently.
🤖 Prompt for AI Agents
In extras/speaker-recognition/docker-compose.yml around lines 111 to 112, the
compose file marks the chronicle-network as external:true but doesn't document
this dependency; update the repository docs by adding a brief note in
extras/speaker-recognition/README.md (or getting-started.md near the
speaker-recognition section) stating that speaker-recognition requires the
chronicle-network to be created by running backends/advanced first (include the
exact docker network name chronicle-network and the startup order:
backends/advanced -> extras/speaker-recognition), and add a one-line reminder in
the docker-compose.yml header comment referencing that external network and
linking to the doc for the startup steps.
Summary by CodeRabbit
Release Notes
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.